var app = angular.module('myApp', []);
app.run(function($rootScope) { //$rootScope变量名不可更改
  var t = $rootScope;
  t.name = "Ari Lerner";
});

app.controller('firstController', function($scope, $http) {
  $scope.person = {
    name: 'firstName'
  };

  $scope.fetchData = function() {
    $http({
      method: 'GET',
      url: 'js/data.json?' + new Date().getTime()
    }).then(function(resp) {
      // data contains the response  
      // status is the HTTP status  
      // headers is the header getter function  
      // config is the object that was used to create the HTTP request
      $scope.resp = resp;
      $scope.data = resp.data;
    }, function(resp) {
      // data contains the response  
      // status is the HTTP status  
      // headers is the header getter function  
      // config is the object that was used to create the HTTP request
    });

  };



});